package com.rd.student.jiaji.class1.jinhongyu.day0802;

public class Store {
    static Animal getInstance(String animalName) {
        if (animalName.equals("dog")) {
            return new Dog("gou1", "hei");
        } else if (animalName.equals("pig")) {
            return new Pig("zhu1");
        } else {
            return new Cat("mao1", "lan");
        }
    }
}

